3.1.81 \(\int \frac {(a+b \log (c x^n))^2 \log (d (e+f x)^m)}{x} \, dx\) [81]

3.1.81.1 Optimal result
3.1.81.2 Mathematica [B] (verified)
3.1.81.3 Rubi [A] (verified)
3.1.81.4 Maple [C] (warning: unable to verify)
3.1.81.5 Fricas [F]
3.1.81.6 Sympy [F(-1)]
3.1.81.7 Maxima [F]
3.1.81.8 Giac [F]
3.1.81.9 Mupad [F(-1)]

3.1.81.1 Optimal result

Integrand size = 26, antiderivative size = 131 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {m \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x}{e}\right )}{3 b n}-m \left (a+b \log \left (c x^n\right )\right )^2 \operatorname {PolyLog}\left (2,-\frac {f x}{e}\right )+2 b m n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (3,-\frac {f x}{e}\right )-2 b^2 m n^2 \operatorname {PolyLog}\left (4,-\frac {f x}{e}\right ) \]

output
1/3*(a+b*ln(c*x^n))^3*ln(d*(f*x+e)^m)/b/n-1/3*m*(a+b*ln(c*x^n))^3*ln(1+f*x 
/e)/b/n-m*(a+b*ln(c*x^n))^2*polylog(2,-f*x/e)+2*b*m*n*(a+b*ln(c*x^n))*poly 
log(3,-f*x/e)-2*b^2*m*n^2*polylog(4,-f*x/e)
 
3.1.81.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(329\) vs. \(2(131)=262\).

Time = 0.11 (sec) , antiderivative size = 329, normalized size of antiderivative = 2.51 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=a^2 \log (x) \log \left (d (e+f x)^m\right )-a b n \log ^2(x) \log \left (d (e+f x)^m\right )+\frac {1}{3} b^2 n^2 \log ^3(x) \log \left (d (e+f x)^m\right )+2 a b \log (x) \log \left (c x^n\right ) \log \left (d (e+f x)^m\right )-b^2 n \log ^2(x) \log \left (c x^n\right ) \log \left (d (e+f x)^m\right )+b^2 \log (x) \log ^2\left (c x^n\right ) \log \left (d (e+f x)^m\right )-a^2 m \log (x) \log \left (1+\frac {f x}{e}\right )+a b m n \log ^2(x) \log \left (1+\frac {f x}{e}\right )-\frac {1}{3} b^2 m n^2 \log ^3(x) \log \left (1+\frac {f x}{e}\right )-2 a b m \log (x) \log \left (c x^n\right ) \log \left (1+\frac {f x}{e}\right )+b^2 m n \log ^2(x) \log \left (c x^n\right ) \log \left (1+\frac {f x}{e}\right )-b^2 m \log (x) \log ^2\left (c x^n\right ) \log \left (1+\frac {f x}{e}\right )-m \left (a+b \log \left (c x^n\right )\right )^2 \operatorname {PolyLog}\left (2,-\frac {f x}{e}\right )+2 b m n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (3,-\frac {f x}{e}\right )-2 b^2 m n^2 \operatorname {PolyLog}\left (4,-\frac {f x}{e}\right ) \]

input
Integrate[((a + b*Log[c*x^n])^2*Log[d*(e + f*x)^m])/x,x]
 
output
a^2*Log[x]*Log[d*(e + f*x)^m] - a*b*n*Log[x]^2*Log[d*(e + f*x)^m] + (b^2*n 
^2*Log[x]^3*Log[d*(e + f*x)^m])/3 + 2*a*b*Log[x]*Log[c*x^n]*Log[d*(e + f*x 
)^m] - b^2*n*Log[x]^2*Log[c*x^n]*Log[d*(e + f*x)^m] + b^2*Log[x]*Log[c*x^n 
]^2*Log[d*(e + f*x)^m] - a^2*m*Log[x]*Log[1 + (f*x)/e] + a*b*m*n*Log[x]^2* 
Log[1 + (f*x)/e] - (b^2*m*n^2*Log[x]^3*Log[1 + (f*x)/e])/3 - 2*a*b*m*Log[x 
]*Log[c*x^n]*Log[1 + (f*x)/e] + b^2*m*n*Log[x]^2*Log[c*x^n]*Log[1 + (f*x)/ 
e] - b^2*m*Log[x]*Log[c*x^n]^2*Log[1 + (f*x)/e] - m*(a + b*Log[c*x^n])^2*P 
olyLog[2, -((f*x)/e)] + 2*b*m*n*(a + b*Log[c*x^n])*PolyLog[3, -((f*x)/e)] 
- 2*b^2*m*n^2*PolyLog[4, -((f*x)/e)]
 
3.1.81.3 Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.07, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {2822, 2754, 2821, 2830, 7143}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx\)

\(\Big \downarrow \) 2822

\(\displaystyle \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {f m \int \frac {\left (a+b \log \left (c x^n\right )\right )^3}{e+f x}dx}{3 b n}\)

\(\Big \downarrow \) 2754

\(\displaystyle \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {f m \left (\frac {\log \left (\frac {f x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )^3}{f}-\frac {3 b n \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (\frac {f x}{e}+1\right )}{x}dx}{f}\right )}{3 b n}\)

\(\Big \downarrow \) 2821

\(\displaystyle \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {f m \left (\frac {\log \left (\frac {f x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )^3}{f}-\frac {3 b n \left (2 b n \int \frac {\left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {f x}{e}\right )}{x}dx-\operatorname {PolyLog}\left (2,-\frac {f x}{e}\right ) \left (a+b \log \left (c x^n\right )\right )^2\right )}{f}\right )}{3 b n}\)

\(\Big \downarrow \) 2830

\(\displaystyle \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {f m \left (\frac {\log \left (\frac {f x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )^3}{f}-\frac {3 b n \left (2 b n \left (\operatorname {PolyLog}\left (3,-\frac {f x}{e}\right ) \left (a+b \log \left (c x^n\right )\right )-b n \int \frac {\operatorname {PolyLog}\left (3,-\frac {f x}{e}\right )}{x}dx\right )-\operatorname {PolyLog}\left (2,-\frac {f x}{e}\right ) \left (a+b \log \left (c x^n\right )\right )^2\right )}{f}\right )}{3 b n}\)

\(\Big \downarrow \) 7143

\(\displaystyle \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d (e+f x)^m\right )}{3 b n}-\frac {f m \left (\frac {\log \left (\frac {f x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )^3}{f}-\frac {3 b n \left (2 b n \left (\operatorname {PolyLog}\left (3,-\frac {f x}{e}\right ) \left (a+b \log \left (c x^n\right )\right )-b n \operatorname {PolyLog}\left (4,-\frac {f x}{e}\right )\right )-\operatorname {PolyLog}\left (2,-\frac {f x}{e}\right ) \left (a+b \log \left (c x^n\right )\right )^2\right )}{f}\right )}{3 b n}\)

input
Int[((a + b*Log[c*x^n])^2*Log[d*(e + f*x)^m])/x,x]
 
output
((a + b*Log[c*x^n])^3*Log[d*(e + f*x)^m])/(3*b*n) - (f*m*(((a + b*Log[c*x^ 
n])^3*Log[1 + (f*x)/e])/f - (3*b*n*(-((a + b*Log[c*x^n])^2*PolyLog[2, -((f 
*x)/e)]) + 2*b*n*((a + b*Log[c*x^n])*PolyLog[3, -((f*x)/e)] - b*n*PolyLog[ 
4, -((f*x)/e)])))/f))/(3*b*n)
 

3.1.81.3.1 Defintions of rubi rules used

rule 2754
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symb 
ol] :> Simp[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^p/e), x] - Simp[b*n*(p/e) 
  Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, 
b, c, d, e, n}, x] && IGtQ[p, 0]
 

rule 2821
Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b 
_.))^(p_.))/(x_), x_Symbol] :> Simp[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c 
*x^n])^p/m), x] + Simp[b*n*(p/m)   Int[PolyLog[2, (-d)*f*x^m]*((a + b*Log[c 
*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 
0] && EqQ[d*e, 1]
 

rule 2822
Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_ 
.)]*(b_.))^(p_.))/(x_), x_Symbol] :> Simp[Log[d*(e + f*x^m)^r]*((a + b*Log[ 
c*x^n])^(p + 1)/(b*n*(p + 1))), x] - Simp[f*m*(r/(b*n*(p + 1)))   Int[x^(m 
- 1)*((a + b*Log[c*x^n])^(p + 1)/(e + f*x^m)), x], x] /; FreeQ[{a, b, c, d, 
 e, f, r, m, n}, x] && IGtQ[p, 0] && NeQ[d*e, 1]
 

rule 2830
Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*PolyLog[k_, (e_.)*(x_)^(q_ 
.)])/(x_), x_Symbol] :> Simp[PolyLog[k + 1, e*x^q]*((a + b*Log[c*x^n])^p/q) 
, x] - Simp[b*n*(p/q)   Int[PolyLog[k + 1, e*x^q]*((a + b*Log[c*x^n])^(p - 
1)/x), x], x] /; FreeQ[{a, b, c, e, k, n, q}, x] && GtQ[p, 0]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
3.1.81.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 33.19 (sec) , antiderivative size = 3957, normalized size of antiderivative = 30.21

method result size
risch \(\text {Expression too large to display}\) \(3957\)

input
int((a+b*ln(c*x^n))^2*ln(d*(f*x+e)^m)/x,x,method=_RETURNVERBOSE)
 
output
-m*dilog((f*x+e)/e)*ln(c)^2*b^2-m*dilog((f*x+e)/e)*ln(x^n)^2*b^2-m*ln(x)*l 
n((f*x+e)/e)*a^2-m*dilog((f*x+e)/e)*a^2-I*m*dilog((f*x+e)/e)*Pi*a*b*csgn(I 
*c)*csgn(I*c*x^n)^2-I*m*dilog((f*x+e)/e)*Pi*a*b*csgn(I*x^n)*csgn(I*c*x^n)^ 
2-2*m*b^2*n*ln(x)*ln(x^n)*polylog(2,-f*x/e)-2*m*b*n*ln(x)*polylog(2,-f*x/e 
)*a+1/4*m*dilog((f*x+e)/e)*Pi^2*b^2*csgn(I*c)^2*csgn(I*c*x^n)^4-1/2*m*dilo 
g((f*x+e)/e)*Pi^2*b^2*csgn(I*c)*csgn(I*c*x^n)^5+1/4*m*dilog((f*x+e)/e)*Pi^ 
2*b^2*csgn(I*x^n)^2*csgn(I*c*x^n)^4-1/2*m*dilog((f*x+e)/e)*Pi^2*b^2*csgn(I 
*x^n)*csgn(I*c*x^n)^5+2*m*dilog((f*x+e)/e)*ln(x)*ln(c)*b^2*n+2*m*dilog((f* 
x+e)/e)*ln(x)*ln(x^n)*b^2*n+2*m*dilog((f*x+e)/e)*ln(x)*a*b*n+1/4*m*ln(x)*l 
n((f*x+e)/e)*Pi^2*b^2*csgn(I*c*x^n)^6+2*m*ln(x)^2*ln((f*x+e)/e)*ln(c)*b^2* 
n+2*m*ln(x)^2*ln((f*x+e)/e)*ln(x^n)*b^2*n+2*m*ln(x)^2*ln((f*x+e)/e)*a*b*n- 
2*m*ln(x)*ln((f*x+e)/e)*ln(c)*ln(x^n)*b^2-2*m*ln(x)*ln((f*x+e)/e)*ln(c)*a* 
b-2*m*ln(x)*ln((f*x+e)/e)*ln(x^n)*a*b-m*b^2*n*ln(x)^2*ln(c)*ln(1+f*x/e)-m* 
b^2*n*ln(x)^2*ln(x^n)*ln(1+f*x/e)-m*b*n*ln(x)^2*ln(1+f*x/e)*a-2*m*b^2*n*ln 
(x)*ln(c)*polylog(2,-f*x/e)+(ln(c)^2*ln(x)*b^2+1/3*b^2*n^2*ln(x)^3+(-I*Pi* 
b^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*ln(x)+I*Pi*b^2*csgn(I*c)*csgn(I*c* 
x^n)^2*ln(x)+I*Pi*b^2*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(x)-I*Pi*b^2*csgn(I*c* 
x^n)^3*ln(x)-b^2*n*ln(x)^2+2*ln(c)*b^2*ln(x)+2*a*b*ln(x))*ln(x^n)-1/4*Pi^2 
*ln(x)*b^2*csgn(I*c*x^n)^6+ln(x)*a^2+b^2*ln(x)*ln(x^n)^2-I*ln(c)*Pi*ln(x)* 
b^2*csgn(I*c*x^n)^3-I*Pi*ln(x)*a*b*csgn(I*c*x^n)^3+1/2*I*ln(x)^2*Pi*b^2...
 
3.1.81.5 Fricas [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2} \log \left ({\left (f x + e\right )}^{m} d\right )}{x} \,d x } \]

input
integrate((a+b*log(c*x^n))^2*log(d*(f*x+e)^m)/x,x, algorithm="fricas")
 
output
integral((b^2*log(c*x^n)^2 + 2*a*b*log(c*x^n) + a^2)*log((f*x + e)^m*d)/x, 
 x)
 
3.1.81.6 Sympy [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\text {Timed out} \]

input
integrate((a+b*ln(c*x**n))**2*ln(d*(f*x+e)**m)/x,x)
 
output
Timed out
 
3.1.81.7 Maxima [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2} \log \left ({\left (f x + e\right )}^{m} d\right )}{x} \,d x } \]

input
integrate((a+b*log(c*x^n))^2*log(d*(f*x+e)^m)/x,x, algorithm="maxima")
 
output
1/3*(b^2*n^2*log(x)^3 + 3*b^2*log(x)*log(x^n)^2 - 3*(b^2*n*log(c) + a*b*n) 
*log(x)^2 - 3*(b^2*n*log(x)^2 - 2*(b^2*log(c) + a*b)*log(x))*log(x^n) + 3* 
(b^2*log(c)^2 + 2*a*b*log(c) + a^2)*log(x))*log((f*x + e)^m) - integrate(1 
/3*(b^2*f*m*n^2*x*log(x)^3 - 3*b^2*e*log(c)^2*log(d) - 6*a*b*e*log(c)*log( 
d) - 3*a^2*e*log(d) - 3*(b^2*f*m*n*log(c) + a*b*f*m*n)*x*log(x)^2 + 3*(b^2 
*f*m*log(c)^2 + 2*a*b*f*m*log(c) + a^2*f*m)*x*log(x) + 3*(b^2*f*m*x*log(x) 
 - b^2*f*x*log(d) - b^2*e*log(d))*log(x^n)^2 - 3*(b^2*f*log(c)^2*log(d) + 
2*a*b*f*log(c)*log(d) + a^2*f*log(d))*x - 3*(b^2*f*m*n*x*log(x)^2 + 2*b^2* 
e*log(c)*log(d) + 2*a*b*e*log(d) - 2*(b^2*f*m*log(c) + a*b*f*m)*x*log(x) + 
 2*(b^2*f*log(c)*log(d) + a*b*f*log(d))*x)*log(x^n))/(f*x^2 + e*x), x)
 
3.1.81.8 Giac [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2} \log \left ({\left (f x + e\right )}^{m} d\right )}{x} \,d x } \]

input
integrate((a+b*log(c*x^n))^2*log(d*(f*x+e)^m)/x,x, algorithm="giac")
 
output
integrate((b*log(c*x^n) + a)^2*log((f*x + e)^m*d)/x, x)
 
3.1.81.9 Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x} \, dx=\int \frac {\ln \left (d\,{\left (e+f\,x\right )}^m\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2}{x} \,d x \]

input
int((log(d*(e + f*x)^m)*(a + b*log(c*x^n))^2)/x,x)
 
output
int((log(d*(e + f*x)^m)*(a + b*log(c*x^n))^2)/x, x)